<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>nearoptimal – Near Optimal Locality Sensitive Hashing &mdash; PyBrain v0.3 documentation</title>
    <link rel="stylesheet" href="../../../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../../',
        VERSION:     '0.3',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../../_static/doctools.js"></script>
    <link rel="top" title="PyBrain v0.3 documentation" href="../../../../index.html" />
    <link rel="prev" title="utilities – Simple but useful Utility Functions" href="../../../utilities.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../../modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="../../../utilities.html" title="utilities – Simple but useful Utility Functions"
             accesskey="P">previous</a> |</li>
        <li><a href="../../../../index.html">PyBrain v0.3 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pybrain.supervised.knn.lsh.nearoptimal">
<h1><tt class="xref docutils literal"><span class="pre">nearoptimal</span></tt> &#8211; Near Optimal Locality Sensitive Hashing<a class="headerlink" href="#module-pybrain.supervised.knn.lsh.nearoptimal" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="pybrain.supervised.knn.lsh.nearoptimal.MultiDimHash">
<em class="property">class </em><tt class="descclassname">pybrain.supervised.knn.lsh.nearoptimal.</tt><tt class="descname">MultiDimHash</tt><big>(</big><em>dim</em>, <em>omega=4</em>, <em>prob=0.80000000000000004</em><big>)</big><a class="headerlink" href="#pybrain.supervised.knn.lsh.nearoptimal.MultiDimHash" title="Permalink to this definition">¶</a></dt>
<dd><p>Class that represents a datastructure that enables nearest neighbours 
search and methods to do so.</p>
<dl class="method">
<dt id="pybrain.supervised.knn.lsh.nearoptimal.MultiDimHash.__init__">
<tt class="descname">__init__</tt><big>(</big><em>dim</em>, <em>omega=4</em>, <em>prob=0.80000000000000004</em><big>)</big><a class="headerlink" href="#pybrain.supervised.knn.lsh.nearoptimal.MultiDimHash.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a hash for arrays of dimension dim.</p>
<p>The hyperspace will be split into hypercubes with a sidelength of
omega * sqrt(sqrt(dim)), that is omega * radius.</p>
<p>Every point in the dim-dimensional euclidean space will be hashed to 
its correct bucket with a probability of prob.</p>
</dd></dl>

<dl class="method">
<dt id="pybrain.supervised.knn.lsh.nearoptimal.MultiDimHash.insert">
<tt class="descname">insert</tt><big>(</big><em>point</em>, <em>satellite</em><big>)</big><a class="headerlink" href="#pybrain.supervised.knn.lsh.nearoptimal.MultiDimHash.insert" title="Permalink to this definition">¶</a></dt>
<dd>Put a point and its satellite information into the hash structure.</dd></dl>

<dl class="method">
<dt id="pybrain.supervised.knn.lsh.nearoptimal.MultiDimHash.knn">
<tt class="descname">knn</tt><big>(</big><em>point</em>, <em>k</em><big>)</big><a class="headerlink" href="#pybrain.supervised.knn.lsh.nearoptimal.MultiDimHash.knn" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the k approximate nearest neighbours of the item in the 
current hash.</p>
<p>Mind that the probabilistic nature of the data structure might not
return a nearest neighbor at all and not the nearest neighbour.</p>
</dd></dl>

</dd></dl>

<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<dl class="last docutils">
<dt><a class="reference external" href="http://web.mit.edu/andoni/www/papers/cSquared.pdf">Near-Optimal Hashing Algorithms for Approximate Nearest Neighbor in High Dimensions</a></dt>
<dd>Paper that describes the algorithm used in this module by Alexandr Andoni
and Piotr Indyk.</dd>
</dl>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../../index.html">
              <img class="logo" src="../../../../_static/pybrain_logo.gif" alt="Logo"/>
            </a></p>
            <h4>Previous topic</h4>
            <p class="topless"><a href="../../../utilities.html"
                                  title="previous chapter"><tt class="docutils literal"><span class="pre">utilities</span></tt> &#8211; Simple but useful Utility Functions</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../../../../_sources/api/supervised/knn/lsh/nearoptimal.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../../../../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../../modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../../../utilities.html" title="utilities – Simple but useful Utility Functions"
             >previous</a> |</li>
        <li><a href="../../../../index.html">PyBrain v0.3 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2009, CogBotLab &amp; Idsia.
      Last updated on Nov 12, 2009.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
    </div>
  </body>
</html>